home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / TURBO PASCAL 1.5 for WIN / TDWDOC.PAK / HDWDEBUG.TDW < prev    next >
Encoding:
Text File  |  1992-06-08  |  7.9 KB  |  194 lines

  1.                          TURBO DEBUGGER FOR WINDOWS
  2.                    USING THE HARDWARE DEBUGGING FEATURES
  3.  
  4.  
  5. CONFIGURING YOUR SYSTEM
  6. =======================
  7.  
  8. Before you can do hardware debugging, you must have loaded TDDEBUG.386
  9. See Chapter 1 of the "Turbo Debugger for Windows User's Guide" to find
  10. out how to load this program.
  11.  
  12.  
  13. SETTING HARDWARE BREAKPOINTS
  14. ============================
  15.  
  16. There are several ways to set a hardware-assisted breakpoint:
  17.  
  18. o Choose Breakpoints|Changed memory global.
  19.  
  20.     In the input box of the dialog box that opens, enter a memory
  21.     address followed by the number of bytes TDW is to watch to determine
  22.     if your program has changed anything in that part of memory.  If you
  23.     enter a variable name or expression as the address, the count refers
  24.     to how many objects of that size to watch.
  25.  
  26.     For example, if your program contains a word-sized variable x,
  27.     typing "x,2" causes two objects of size sizeof(x) (4 bytes total)
  28.     to be watched.
  29.  
  30.     When you set a breakpoint using the Changed Memory Global command, TDW
  31.     automatically determines whether that breakpoint can make use of the
  32.     available hardware.  If it can, TDW sets a hardware breakpoint for you
  33.     and indicates that the breakpoint is set in hardware by putting an
  34.     asterisk (*) after the global breakpoint number in the left pane of the
  35.     Breakpoints window.
  36.  
  37. o Choose Breakpoints|Hardware Breakpoint.
  38.  
  39.     Use this command to set a general-purpose hardware breakpoint. This
  40.     command displays the Hardware Breakpoint Options dialog box (described
  41.     later).
  42.  
  43. o Use the Breakpoint Options dialog box (see the paragraphs after the next
  44.   one for an explanation of how to display this dialog box) to get to the
  45.   Hardware Breakpoint Options dialog box (described later).
  46.  
  47.     In the Breakpoint Options dialog box, check the Global checkbox, then
  48.     press the Change button to display the Conditions and Actions dialog
  49.     box. In this dialog box, select the Hardware radio button in the
  50.     Condition group, then press the Hardware button at the bottom of the
  51.     box to display the Hardware Breakpoint Options dialog box.
  52.  
  53.     You can get to the Breakpoint Options dialog box from two locations:
  54.     the Breakpoints menu or the Breakpoints view window.
  55.  
  56.     - Choose Breakpoints|At (Alt-B A) to display the Breakpoint Options
  57.       dialog box.
  58.  
  59.     - Choose View|Breakpoints to display the Breakpoints window. In the left
  60.       pane, highlight the breakpoint you want to work with, then display the
  61.       local menu (Alt-F10 or right-hand mouse click) and choose the Set
  62.       Options or the Add command to display the Breakpoint Options dialog box.
  63.  
  64.  
  65. USING THE HARDWARE BREAKPOINT OPTIONS DIALOG BOX
  66. ================================================
  67.  
  68. This section starts with a description of the hardware and software
  69. limitations on the hardware conditions you can set with TDW,
  70. and then explains all the options you can set from the Hardware
  71. Breakpoints Dialog box.
  72.  
  73.  
  74. Hardware conditions permitted with TDDEBUG.386
  75. ----------------------------------------------
  76.  
  77. When you're using TDDEBUG.386 with TDW, you can set the following
  78. types of hardware breakpoints from the Hardware Breakpoint dialog box:
  79.  
  80. o instruction fetch
  81.  
  82. o read from memory
  83.  
  84. o read/write memory
  85.  
  86. Because you can't set any type of data matching when you use TDDEBUG.386,
  87. you must always set the Data Match radio buttons to Match All. You can
  88. also match only a single memory address or range of memory addresses.
  89. A range can encompass from 1 to 16 bytes, depending on how many other
  90. hardware breakpoints you have set and the address of the beginning of
  91. the range.
  92.  
  93. The other options in the Hardware Breakpoint dialog are for other hardware
  94. debuggers and device drivers that might support more matching modes.
  95.  
  96.  
  97. The Hardware Breakpoint Options dialog box
  98. ------------------------------------------
  99.  
  100. This section describes the options on the Hardware Breakpoint Options
  101. dialog box. Remember that your hardware most likely doesn't support
  102. all combinations of matching that you can specify from this menu. The
  103. previous section describes the combinations that are allowed for the
  104. TDH386.SYS and TDDEBUG.386 device drivers supplied with TDW.
  105.  
  106. The Hardware Breakpoint Options dialog box lets you set the three matching
  107. criteria that make up a hardware breakpoint:
  108.  
  109. o the bus cycle type to be matched
  110.  
  111. o the range of addresses to be matched
  112.  
  113. o the range of data values to be matched
  114.  
  115. For example, a hardware breakpoint might say "Watch for an I/O write
  116. anywhere from address 3F8 to 3FF as long as the data value is equal to
  117. 1." This breakpoint will then be triggered any time a byte of 1 is
  118. written to any of the I/O locations that control the COM1 serial port.
  119.  
  120. Usually, you set far simpler hardware breakpoints than this, such
  121. as "Watch for I/O to address 200."
  122.  
  123.   Cycle Type radio buttons
  124.   ------------------------
  125.  
  126.   With these radio buttons, you can make one of the following settings:
  127.  
  128.   Read Memory          Match memory reads
  129.   Write Memory         Match memory writes
  130.   Access Memory        Match memory read or write
  131.   Input I/O            Match I/O input
  132.   Output I/O           Match I/O Output
  133.   Both I/O             Match I/O input or output
  134.   Fetch Instruction    Match instruction fetch
  135.  
  136.   The Access Memory option is a combination of the Read Memory and Write
  137.   Memory options--it matches either memory reads or writes. Likewise,
  138.   the Both I/O option matches I/O reads or writes.
  139.  
  140.   Some hardware debuggers are capable of distinguishing between simple
  141.   data reads from memory and instruction fetches. In this case, if you
  142.   set a breakpoint to match on read memory, an instruction fetch from
  143.   that location will not trigger the hardware breakpoint. Instruction
  144.   cycles include all the bytes that the processor reads in order to
  145.   determine the instruction operation to perform, including prefix
  146.   bytes, operand addresses, and immediate values. The actual data read
  147.   or written to memory referenced by an operand's address is not
  148.   considered to be part of the instruction fetch. For example,
  149.  
  150.       MOV    AX,[1234]
  151.  
  152.   fetches 3 instruction bytes from memory and reads 2 data bytes. If you
  153.   use instruction fetch matching, remember that the 80x86 processor
  154.   family prefetches instructions to be executed, so you may get false
  155.   matches, depending on whether your hardware debugger can sort out
  156.   prefetched instructions from ones that are really executed.
  157.  
  158.   Address radio buttons
  159.   ---------------------
  160.  
  161.   With these radio buttons, you can make one of the following settings:
  162.  
  163.   Above              Match above an address
  164.   Below              Match below an address
  165.   Range              Match within address range
  166.   Not Range          Match outside address range
  167.   Less or Equal      Match below or equal to address
  168.   Greater or Equal   Match above or equal to address
  169.   Equal              Match a single address
  170.   Unequal            Match all but a single address
  171.   Match All          Match any address
  172.  
  173.  
  174.   Data Match radio buttons
  175.   ------------------------
  176.  
  177.   The Data Match radio buttons let you make the following settings:
  178.  
  179.   Above              Match above a value
  180.   Below              Match below a value
  181.   Range              Match within value range
  182.   Not Range          Match outside value range
  183.   Less or Equal      Match below or equal to value
  184.   Greater or Equal   Match above or equal to value
  185.   Equal              Match a single value
  186.   Unequal            Match all but a single value
  187.   Match All          Match any value
  188.  
  189.   If you turn on a Data or Address option that involves any less-than or
  190.   greater-than condition, a single address match range either starts at
  191.   zero and extends to the value you specified, or starts at the value
  192.   you specified and extends to the highest allowed value for addresses
  193.   or data.
  194.